<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>客户信息记录系统</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/gray/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/plugin/portal/jquery.portal.js"></script>
    <script type="text/javascript" src="easyui/plugin/easyui.resize.js"></script>
    <link rel="stylesheet" type="text/css" href="easyui/plugin/portal/portal.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script type="text/javascript" src="easyui/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" type="text/css" href="easyui/plugin/texteditor/texteditor.css">
    <script type="text/javascript" src="easyui/plugin/texteditor/jquery.texteditor.js"></script>
    <style>
        body {
            background: #dddddd none repeat scroll 0 0;
            font-size: 13px;
        }

        .tac {
            text-align: center;
        }

        table.form {
            display: inline-block;
        }

        table.form tr td {
            padding: 5px;
            border: 1px solid gainsboro;
        }

        table.form tr td input, table.form tr td select {
            width: 240px;
        }
    </style>
</head>
<body>
<div class="tac" style="margin-top: 10%;"><img src="css/logo.png" height="80px;"></div>
<div class="tac">
    <form id="form_login" method="post">
        <table class="form">
            <tr>
                <td><input class="easyui-textbox" name="username"
                           data-options="label:'用户名:',required:true"></td>
                <td><input class="easyui-textbox" name="password"
                           data-options="label:'密&nbsp;&nbsp;码:',required:true,type:'password'"></td>
                <td><a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="form_login()">提交</a>
                </td>
            </tr>
        </table>
    </form>
</div>
<script>
    $(function () {
        $('#form_login').form({
            url: "y.php?r=site/login",
            onSubmit: function () {
                return $("#form_login").form("validate");
            },
            success: function (data) {
                var json = eval('('+data+')');
                if(json.code == '10000'){
                    window.location.href = "y.php?r=site/home";
                }else{
                    //提示信息
                    alert(json.message);
                }
            }
        });
    });
    function form_login() {
        $('#form_login').form("submit");
    }
</script>
</body>
</html>